Package server.netsiddev


package server.netsiddev
Provides the server-side implementation of the Network SID Device Protocol, enabling JSIDPlay2 to act as a network-accessible SID emulation device.

This package exposes a TCP/IP service (default port 6581) that allows external software—such as ACID64 or other SID players supporting the Network SID Device Protocol—to send SID register events and control playback remotely. The server behaves like a physical SID chip connected over the network.

Overview

The Network SID Device Protocol defines a request–response communication model. Each request from the client consists of:

  • 8-bit command identifier
  • 8-bit SID number
  • 16-bit data length
  • Command-specific binary payload

The server responds with well-defined messages such as OK, BUSY, READ, VERSION, COUNT, or INFO, depending on the command type and state.

Purpose

The classes in this package handle incoming socket connections, parse and execute protocol commands, and manage SID emulation threads that generate real-time audio output. It serves as a bridge between network-based SID control messages and the underlying SID chip emulators provided by builder.netsiddev.

Protocol Versions

  • Version 1: Basic commands (FLUSH, RESET, WRITE, READ)
  • Version 2: Multiple SID devices, configurable sampling and clocking
  • Version 3: Voice 4 (digi channel) mute control
  • Version 4: Extended fade, delay, and SID header control

Command Categories

  • Playback Control: FLUSH, TRY_RESET, TRY_DELAY
  • Register Access: TRY_WRITE, TRY_READ
  • Configuration: TRY_SET_SAMPLING, SET_CLOCKING, SET_SID_MODEL, SET_SID_POSITION, SET_SID_LEVEL
  • Metadata and Effects: SET_DELAY, SET_FADE_IN, SET_FADE_OUT, SET_SID_HEADER

Implementation Details

The server maintains a queue of SID register write events per connected client and ensures timing accuracy by aligning event playback with the emulated C64 clock. Real-time audio output is produced by the AudioGeneratorThread, which mixes and resamples the audio streams from one or more SID instances.

To maintain synchronization, clients are encouraged to send small packets containing short bursts of SID activity (≈1 ms of data). Larger packets may increase jitter and cause playback desynchronization.

Usage

The Network SID Device can be launched as a standalone service, providing a virtual SID hardware endpoint accessible to other SID-aware software:

 jsiddevice.sh
 jsiddevice-console.sh
 

On Windows, the GUI version is available as jsiddevice-*.exe.

Authors: Antti S. Lankila, Dag Lem, Ken Händel